package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCrmFhdDetailMapper;
import com.ruoyi.system.domain.SysCrmFhdDetail;
import com.ruoyi.system.service.ISysCrmFhdDetailService;

/**
 * 发货单详情Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-16
 */
@Service
public class SysCrmFhdDetailServiceImpl implements ISysCrmFhdDetailService 
{
    @Autowired
    private SysCrmFhdDetailMapper sysCrmFhdDetailMapper;

    /**
     * 查询发货单详情
     * 
     * @param fhNumber 发货单详情主键
     * @return 发货单详情
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public SysCrmFhdDetail selectSysCrmFhdDetailByFhNumber(String fhNumber)
    {
        return sysCrmFhdDetailMapper.selectSysCrmFhdDetailByFhNumber(fhNumber);
    }

    /**
     * 查询发货单详情列表
     * 
     * @param sysCrmFhdDetail 发货单详情
     * @return 发货单详情
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<SysCrmFhdDetail> selectSysCrmFhdDetailList(SysCrmFhdDetail sysCrmFhdDetail)
    {
        return sysCrmFhdDetailMapper.selectSysCrmFhdDetailList(sysCrmFhdDetail);
    }

    /**
     * 新增发货单详情
     * 
     * @param sysCrmFhdDetail 发货单详情
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertSysCrmFhdDetail(SysCrmFhdDetail sysCrmFhdDetail)
    {
        return sysCrmFhdDetailMapper.insertSysCrmFhdDetail(sysCrmFhdDetail);
    }

    /**
     * 修改发货单详情
     * 
     * @param sysCrmFhdDetail 发货单详情
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateSysCrmFhdDetail(SysCrmFhdDetail sysCrmFhdDetail)
    {
        return sysCrmFhdDetailMapper.updateSysCrmFhdDetail(sysCrmFhdDetail);
    }

    /**
     * 批量删除发货单详情
     * 
     * @param fhNumbers 需要删除的发货单详情主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysCrmFhdDetailByFhNumbers(String[] fhNumbers)
    {
        return sysCrmFhdDetailMapper.deleteSysCrmFhdDetailByFhNumbers(fhNumbers);
    }

    /**
     * 删除发货单详情信息
     * 
     * @param fhNumber 发货单详情主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysCrmFhdDetailByFhNumber(String fhNumber)
    {
        return sysCrmFhdDetailMapper.deleteSysCrmFhdDetailByFhNumber(fhNumber);
    }
}
